PRNSET.DLL Instructions for use. The following type definition is necessary for passing the parameters from Visual Basic to the DLL: Type ARP_Parm Orient As Integer size As Integer Length As Integer Width As Integer Scal As Integer Copies As Integer Source As Integer Quality As Integer color As Integer duplex As Integer End Type The function declare is as follows: Declare Function ARP_PrintSet Lib "PRNSET.DLL" (Parms As ARP_Parm, ByVal Mode As Integer, ByVal Dev As String, ByVal Port As String) As Integer Next are the global constants for use in the different parameters: Rem orientation selections Global Const DMORIENT_PORTRAIT = 1 Global Const DMORIENT_LANDSCAPE = 2 Rem paper selections Global Const DMPAPER_FIRST = 1 ' Letter 8 1/2 x 11 in Global Const DMPAPER_LETTER = 1 ' Letter 8 1/2 x 11 in Global Const DMPAPER_LETTERSMALL = 2 ' Letter Small 8 1/2 x 11 in Global Const DMPAPER_TABLOID = 3 ' Tabloid 11 x 17 in Global Const DMPAPER_LEDGER = 4 ' Ledger 17 x 11 in Global Const DMPAPER_LEGAL = 5 ' Legal 8 1/2 x 14 in Global Const DMPAPER_STATEMENT = 6 ' Statement 5 1/2 x 8 1/2 in Global Const DMPAPER_EXECUTIVE = 7 ' Executive"7 1/2 x 10 in Global Const DMPAPER_A3 = 8 ' A3 297 x 420 mm Global Const DMPAPER_A4 = 9 ' A4 210 x 297 mm Global Const DMPAPER_A4SMALL = 10 ' A4 Small 210 x 297 mm Global Const DMPAPER_A5 = 11 ' A5 148 x 210 mm Global Const DMPAPER_B4 = 12 ' B4 250 x 354 Global Const DMPAPER_B5 = 13 ' B5 182 x 257 mm Global Const DMPAPER_FOLIO = 14 ' Folio 8 1/2 x 13 in Global Const DMPAPER_QUARTO = 15 ' Quarto 215 x 275 mm Global Const DMPAPER_10X14 = 16 ' 10x14 in Global Const DMPAPER_11X17 = 17 ' 11x17 in Global Const DMPAPER_NOTE = 18 ' Note 8 1/2 x 11 in Global Const DMPAPER_ENV_9 = 19 ' Envelope #9 3 7/8 x 8 7/8 Global Const DMPAPER_ENV_10 = 20 ' Envelope #10 4 1/8 x 9 1/2 Global Const DMPAPER_ENV_11 = 21 ' Envelope #11 4 1/2 x 10 3/8 Global Const DMPAPER_ENV_12 = 22 ' Envelope #12 4 \276 x 11 Global Const DMPAPER_ENV_14 = 23 ' Envelope #14 5 x 11 1/2 Global Const DMPAPER_CSHEET = 24 ' C size sheet Global Const DMPAPER_DSHEET = 25 ' D size sheet Global Const DMPAPER_ESHEET = 26 ' E size sheet Global Const DMPAPER_LAST = 26 ' E size sheet Rem bin selections Global Const DMBIN_FIRST = 1 Global Const DMBIN_UPPER = 1 Global Const DMBIN_ONLYONE = 1 Global Const DMBIN_LOWER = 2 Global Const DMBIN_MIDDLE = 3 Global Const DMBIN_MANUAL = 4 Global Const DMBIN_ENVELOPE = 5 Global Const DMBIN_ENVMANUAL = 6 Global Const DMBIN_AUTO = 7 Global Const DMBIN_TRACTOR = 8 Global Const DMBIN_SMALLFMT = 9 Global Const DMBIN_LARGEFMT = 10 Global Const DMBIN_LARGECAPACITY = 11 Global Const DMBIN_CASSETTE = 14 Global Const DMBIN_LAST = 14 Rem print qualities Global Const DMRES_DRAFT = -1 Global Const DMRES_LOW = -2 Global Const DMRES_MEDIUM = -3 Global Const DMRES_HIGH = -4 Rem color enable/disable for color printers Global Const DMCOLOR_MONOCHROME = 1 Global Const DMCOLOR_COLOR = 2 Rem duplex enable Global Const DMDUP_SIMPLEX = 1 Global Const DMDUP_VERTICAL = 2 Global Const DMDUP_HORIZONTAL = 3 The function requires four parameters. The first parameter is a variable defined as the type ARP_Parm. You can call the type anything you want, but it MUST be of the same structure as the one above. This user defined type contains the different elements that you can change for the default printer driver. (Only the ones that are supported for your printer will function.) If you do not wish to change one of the parameters set it to -1. Otherwise the DLL will write the value that you supply into the current printer's settings. The second parameter is the Mode. The Mode can be one of three numbers: 0 - Do not change anything, but return the current settings in the parm user defined type variable that you supply. 1 - Change the current printer driver settings to reflect the ones that you supply in the parm user defined type variable. 2 - Display the printer driver's setup dialog box and also use the settings that you supply in the parm user defined type varialbe. (You can set the values to -1 to ignore them and use just what the user inputs in the dialog box.) The last two parameters are buffers of 81 and 21 spaces respectively. These buffers contain the default device and port settings. If you do not care about these two values then you must at least supply "" as the value for these two parameters. Include with this DLL is a VB program that you can play with and look at to see the methods that I use for manipulating the DLL.